package com.steve.summary.seata.feign;

import com.steve.summary.seata.entity.Storage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author: STEVE
 * @Description: 库存服务Feign接口
 * @since: 2025-07-09
 */
@FeignClient(name = "storage-service", path = "/storage")
public interface StorageFeignClient {

    @PostMapping("/decrease")
    void decrease(@RequestParam("productId") String productId, @RequestParam("count") Integer count);

    @PostMapping("/getByProductId")
    Storage getByProductId(@RequestParam("productId") String productId);

    @PostMapping("/increase")
    void increase(@RequestParam("productId") String productId, @RequestParam("count") Integer count);

}
